-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parameter System Testing #33
base: main
Are you sure you want to change the base?
Conversation
1425128
to
e13ca90
Compare
e13ca90
to
eea01f3
Compare
test/scripts/update-param-sys.py
Outdated
cmd("Linux_Example Command_Router_Instance-Noop_Arg with Value 1") | ||
wait(1.0) | ||
# Check successful command count is 2 and that the last success was Noop_Arg with last Value 1: | ||
check_formatted("Linux_Example Software_Status_Packet Command_Router_Instance.Command_Success_Count.Value == '2'") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. To improve this pattern for more general use I suggest the following:
- Is there a wait-on-value directive in COSMOS? Ideally you would just be waiting for the condition that the command success count is == 2, or timeout if it does not reach that? Waiting for a time is brittle and artificially slow. This could be an issue when we want to start running tests as fast as possible with randomized inputs.
- We should wrap this logic into a function that does the following: 1) Check the current value of Command_Success_Count (and Command_Fail_Count too) and save them off 2) send command 3) wait for command success count to increment and return, or time out and check command fail count to see if it has incremented 4) return value of 0 for success, 1 for fail, 2 for timeout (or something like this).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably also want a function that does the opposite. If the former function was called wait_for_cmd_success
we would also want one that is wait_for_cmd_failure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a wait-on-value directive in COSMOS?
wait_check
is similar to the check_formatted
pattern, but adds a timeout argument. Switching to this eliminates the need for wait
calls. Switched to wait_check
in 9b73651.
We should wrap this logic into a function that does the following: [...]
Probably also want a function that does the opposite.
I will try to implement this in a future commit. check_exception
allows for checking expressions expected to fail, although I think in all cases, if the API function call causes the script to stop then manual intervention is always required to resume or restart. This behavior may be different when not instrumenting each line.
b822d13
to
5c9b2be
Compare
8d4d0ba
to
44c9542
Compare
Since commit 8bc9f2d, it will be necessary to ensure
Followed by:
|
This draft pull request includes Python scripts which can be used with COSMOS to test parameter system functionality, namely table validate and table update commands. A mock table is generated as a byte array, and various responses are scintillated by sending commands and checking the Software_Status_Packet that is returned.